<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/9/23 0023
 * Time: 14:15
 */

namespace App\Http\Controllers\Api;

use App\Models\Cart;
use App\Models\UserFootprint;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;


class CartController extends Controller
{
    public function CartList(Request $request){

        $user=auth('api')->user();


        var_dump($user);exit;
        if($user && $user->user_id){
            //获取所有的订单列表
            $cart_list = Cart::carts();
            $data['favourite'] = UserFootprint::userFavorite($user->user_id);
        }else{
            //猜你喜欢
            $data['favourite'] = UserFootprint::userFavorite();
        }
        return $this->success($data);

    }
}